@include('admin.head')
<div class="container">
	<div class="row">
		@include('admin.side')
		<div class="col-md-10" id="content-wrapper">
			<div id="myTabContent" class="tab-content">
			 	<div class="tab-pane fade active in" id="home">
					<div class="row">
						<div class="col-xs-12">
							<div class=" clearfix">
								<div class="clearfix">
									<h2 class="pull-left">静态页面添加</h2>
								</div>
								<div class="panel panel-default" id="base">
									<div class="panel-body">
										<div class="form-horizontal">
											<fieldset>
												<div class="form-group">
													<label class="col-xs-3 control-label no_padding_right">页面名称:</label>
													<div class="col-xs-4">
														<input class="form-control input_size" name="name"  placeholder="" type="text">
													</div>
												</div>
												<div class="form-group">
													<label for="" class="col-xs-3 control-label no_padding_right">
														唯一标识:
													</label>
													<div class="col-xs-4">
														<input type="text" class="form-control input_size" name="unique_key">
													</div>
												</div>
												<div class="form-group">
													<div class="col-xs-12 text-center">
														<input type="hidden" name="did">
														<button type="button" id="pro_sub" class="btn btn-primary ">提交</button>
													</div>
												</div>
											</fieldset>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
			  	</div>
			</div>
		</div>
	</div>
</div>
@include("admin.footer")
@include("admin.common")
</body>

<script type="text/javascript">
var url = "<%url('admin')%>/";

$("#pro_sub").click(function(){
	var name = $("input[name='name']").val().trim();
	if( name =='' )
	{
		error("", "页面名称不能为空!");
		return false;
	}

	var uniqueKey = $("input[name='unique_key']").val().trim();
	if(uniqueKey == "")
	{
		error("", "唯一标识不能为空");
		return;
	}

	$.post(url + "page/save_page",{
		page_name : name,
		unique_key: uniqueKey
	},function (data){
		if(data.success){
			success("", "提交成功");
			setTimeout(function(){
				window.location.href="../page";
			}, 1000);
		}
		else{
			error("" ,data.msg);
		}
	})
})

</script>

</html>